package com.example.bluetoothtest;

import android.Manifest;
import android.annotation.SuppressLint;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothSocket;
import android.content.Context;
import android.util.Log;

import androidx.core.content.ContextCompat;

import java.io.File;
import java.util.ArrayList;

public class BlueToothController {

    //成员变量
    private BluetoothSocket bluetoothSocket;
    private BluetoothGatt activeGatt;
    private BluetoothAdapter mAdapter;


    public BlueToothController(){
        // 获取本地的蓝牙适配器
        mAdapter = BluetoothAdapter.getDefaultAdapter();
    }


    /**
     * 获取绑定设备
     * @return
     */
    @SuppressLint("MissingPermission")
    public ArrayList<BluetoothDevice> getBondedDeviceList(){
        return new ArrayList<>(mAdapter.getBondedDevices());
    }


}
